import { BannerItem, ForntCategoryItem, GuessLikeItem, GuessLikePageParams, HotPanelItem } from "./types";
import { http } from "../utils/http";

/**
 * 首页-广告区域-小程序
 * @param distributionSite 广告区域展示位置（投放位置 投放位置，1为首页，2为分类商品页） 默认是1
 */
export const getHomeBannerAPI = (distributionSite = 1) => {
  return http<BannerItem[]>({
    method: "GET",
    url: "/home/banner",
    data: {
      distributionSite,
    },
  });
};

/**
 * 首页-前台分类-小程序
 */
export const getForntCategory = () => {
  return http<ForntCategoryItem[]>({
    method: "GET",
    url: "/home/category/mutli",
  });
};
export const getHotPanel = () => {
  return http<HotPanelItem[]>({
    method: "GET",
    url: "/home/hot/mutli",
  });
};
export const getGuessLike = (data?: GuessLikePageParams) => {
  return http<GuessLikeItem>({
    method: "GET",
    url: "/home/goods/guessLike",
    data,
  });
};
